import request from '@/utils/request'

// 统一前缀
var prefix = '/recruitService'

// 获取简历
export function lookOneResume(id) {
  return request({
    url: `${prefix}/resume`,
    params: { id: id },
    method: 'GET',
  })
}

// 添加简历
export function addOneResume(data) {
  return request({
    url: `${prefix}/resume`,
    data: data,
    method: 'POST',
  })
}

// 更新简历
export function updateResume(data) {
  return request({
    url: `${prefix}/resume`,
    data: data,
    method: 'PUT',
  })
}

// 删除简历
export function deleteResume(id) {
  return request({
    url: `${prefix}/resume`,
    params: { id: id },
    method: 'DELETE',
  })
}
//投递简历
export function submitResume(postId, resumeId) {
  return request({
    url: `${prefix}/resume/submit`,
    method: 'POST',
    params: {
      postId: postId,
      resumeId: resumeId,
    },
  })
}

//查看已投递的岗位列表
export function lookPostList(current, size, userId) {
  return request({
    url: `${prefix}/resume/post`,
    method: 'GET',
    params: {
      userId: userId,
      current: current,
      size: size,
    },
  })
}

//简历列表
export function lookResumeListForUser(current, size, userId) {
  return request({
    url: `${prefix}/resume/list`,
    method: 'GET',
    params: {
      userId: userId,
      current: current,
      size: size,
    },
  })
}
